{% extends "base.html" %}

{% block title %}{{ task_list.name|escape }} - {{ application_name }}{% endblock %}

{% block head %}
  <style type="text/css">

  #body {
    margin-left: 10px;
    margin-right: 10px;
  }

  h1 {
    margin: 0;
  }

  ul.event {
    margin: 0;
    padding: 0;
    margin-left: 1.25em;
    list-style-type: square;
  }

  ul.event li {
    margin-top: 0.75em;
  }

  .completed {
    color: gray;
    text-decoration: line-through;
  }
  .completed:hover {
    color: black;
    text-decoration: none;
  }
  
  .backlink {
    text-decoration: none;
    float: left;
    font-size: 2em;
    margin-right: 10px;
  }

  .conditionlink {
    text-decoration: none;
    margin-left: 10px;
    font-size: 0.8em;
  }

  </style>
{% endblock %}

{% block body %}
  <a class="backlink" href="/">&lt;&lt;</a>
  <h1>{{ event.name|escape }}</h1>

  <ul class="event">
    {% for condition in conditions %}
      <li{% if condition.completed %} class="completed"{% endif %}>
        {{ condition.description|escape }}
        <a class="conditionlink" href="/condition?id={{ condition.key|urlencode }}">
          {% if condition.nb_comments %}
            {% ifequal condition.nb_comments 1 %}
              See the one comment
            {% else %}
              See all {{condition.nb_comments}} comments
            {% endifequal %}          
          {% else %}
            No comment... Yet?
          {% endif %}
        </a>
      </li>
    {% endfor %}
  </ul>
{% endblock %}
